<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>水果商城</title>
    <meta name="robots" content="noindex, follow">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Favicon -->
    

    <!-- CSS
	============================================ -->
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/bootstrap.min.css">
    <!-- FontAwesome -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/font.awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/ionicons.min.css">
    <!-- Slick CSS -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/slick.min.css">
    <!-- Animation -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/animate.min.css">
    <!-- jQuery Ui -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/jquery-ui.min.css">
    <!-- Nice Select -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/nice-select.min.css">
    <!-- Magnific Popup -->
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/magnific-popup.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/s_index/css/style.css">
    
    
    
</head>

<body>

    <div class="home-wrapper home-1">
        <!-- Header Area Start Here -->
        <header class="main-header-area">
            <!-- Header Top Area Start Here -->
            <div class="header-top-area">
                <div class="container container-default-2 custom-area">
                    <div class="row">
                        <div class="col-12 col-custom header-top-wrapper text-center">
                            <div class="short-desc text-white">
                                <p>新 产 品 打 35 折</p>
                            </div>
                            <div class="header-top-button">
                                <a href="shop-fullwidth.html">开 始 购 物</a>
                            </div>
                            <span class="top-close-button">X</span>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Header Top Area End Here -->
            <!-- Main Header Area Start -->
            <div class="main-header">
                <div class="container container-default custom-area">
                    <div class="row">
                        <div class="col-lg-12 col-custom">
                            <div class="row align-items-center">
                                <div class="col-lg-2 col-xl-2 col-sm-6 col-6 col-custom">
                                    <div class="header-logo d-flex align-items-center">
                                        <a href="">
                                            <img class="img-full" src="<%=request.getContextPath() %>/s_index/picture/logo.png" alt="Header Logo">
                                        </a>
                                    </div>
                                </div>
                                <div class="col-lg-8 col-xl-7 position-static d-none d-lg-block col-custom">
                                    <nav class="main-nav d-flex justify-content-center">
                                        <ul class="nav">
                                            <li>
                                                <a class="active" href="">
                                                    <span class="menu-text">首页🍒</span>
                                                    <!-- <i class="fa fa-angle-down"></i> -->
                                                </a>
                                            </li>
                                            <li>
                                                <a href="shop.html">
                                                    <span class="menu-text">商店🍋</span>
                                                    <!-- <i class="fa fa-angle-down"></i> -->
                                                </a>
                                            </li>
                                            <li>
                                                <a href="blog-details-fullwidth.html">
                                                    <span class="menu-text">日志 🍓</span>
                                                    <!-- <i class="fa fa-angle-down"></i> -->
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <span class="menu-text">文稿🍎</span>
                                                    <!-- <i class="fa fa-angle-down"></i> -->
                                                </a>
                                            </li>
                                            <li>
                                                <a href="about-us.html">
                                                    <span class="menu-text">关于🍍</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="contact-us.html">
                                                    <span class="menu-text">联系我们🥝</span>
                                                </a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                                <div class="col-lg-2 col-xl-3 col-sm-6 col-6 col-custom">
                                	<div class="header-right-area main-nav">
                                    	<ul class="nav">
                                        	<li class="login-register-wrap d-none d-xl-flex">
                                        	<c:if test="${name == null}">
                                        		<span><a href="<%=request.getContextPath() %>/uc/login">登录</a></span>
                                                <span><a href="<%=request.getContextPath() %>/uc/reg">注册</a></span>
                                        	</c:if>
                                        		<c:if test="${name ne null}">
                                        		<span>欢迎: ${name} </span>
                                                <span><a href="<%=request.getContextPath() %>/uc/breakIndex">退出登录</a></span>
                                                </c:if>
                                            </li>
                                            <c:if test="${name ne null}">
                                            <li class="minicart-wrap">
                                                <a href="<%=request.getContextPath() %>/CartController/cart?id=${uId}" class="minicart-btn toolbar-btn">
                                                	<h5>🛒</h5>
                                                </a>
                                            </li>
                                             </c:if>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Main Header Area End -->
            <!-- Sticky Header Start Here-->
            <div class="main-header header-sticky">
                <div class="container container-default custom-area">
                    <div class="row">
                        <div class="col-lg-12 col-custom">
                            <div class="row align-items-center">
                                <div class="col-lg-2 col-xl-2 col-sm-6 col-6 col-custom">
                                    <div class="header-logo">
                                        <a href="">
                                            <img class="img-full" src="<%=request.getContextPath() %>/s_index/picture/logo.png" alt="Header Logo">
                                        </a>
                                    </div>
                                </div>
                                <div class="col-lg-8 col-xl-7 position-static d-none d-lg-block col-custom">
                                    <nav class="main-nav d-flex justify-content-center">
                                        <ul class="nav">
                                            <li>
                                                <a class="active" href="">
                                                    <span class="menu-text">首页🍒</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="shop.html">
                                                    <span class="menu-text">商店🍋</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="blog-details-fullwidth.html">
                                                    <span class="menu-text">日志 🍓</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <span class="menu-text">文稿🍎</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="about-us.html">
                                                    <span class="menu-text">关于🍍</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="contact-us.html">
                                                    <span class="menu-text">联系我们🥝</span>
                                                </a>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                                 <div class="col-lg-2 col-xl-3 col-sm-6 col-6 col-custom">
                                	<div class="header-right-area main-nav">
                                    	<ul class="nav">
                                        	<li class="login-register-wrap d-none d-xl-flex">
                                        	<c:if test="${name == null}">
                                        		<span><a href="<%=request.getContextPath() %>/uc/login">登录</a></span>
                                                <span><a href="<%=request.getContextPath() %>/uc/reg">注册</a></span>
                                        	</c:if>
                                        		<c:if test="${name ne null}">
                                        		<span>欢迎: ${name} </span>
                                                <span><a href="<%=request.getContextPath() %>/uc/breakIndex">退出登录</a></span>
                                                </c:if>
                                            </li>
                                            <c:if test="${name ne null}">
                                            <li class="minicart-wrap">
                                                <a href="<%=request.getContextPath() %>/CartController/cart?id=${uId}" class="minicart-btn toolbar-btn">
                                                	<h5>🛒</h5>
                                                </a>
                                            </li>
                                             </c:if>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        <!-- Header Area End Here -->
        <!-- Begin Slider Area One -->
        
        <!-- Slider Area One End Here -->
        <!-- Feature Area Start Here -->
        <div class="feature-area">
            <div class="container container-default custom-wrapper">
                <div class="row">
                    <div class="col-xl-6 col-lg-5 col-md-12 col-custom">
                        <div class="feature-content-wrapper">
                            <h2 class="title">Important to eat fruit</h2>
                            <p class="desc-content">Eating fruit provides health benefits — people who eat more fruits and vegetables as part of an overall healthy diet are likely to have a reduced risk of some chronic diseases. Fruits provide nutrients vital for health and maintenance of your body.</p>
                            <p class="desc-content"> Fruits are sources of many essential nutrients that are underconsumed, including potassium, dietary fiber, vitamin C, and folate (folic acid).</p>
                            <p class="desc-content"> Most fruits are naturally low in fat, sodium, and calories. None have cholesterol.</p>
                        </div>
                    </div>
                    <div class="col-xl-6 col-lg-7 col-md-12 col-custom">
                        <div class="feature-image">
                            <img src="<%=request.getContextPath() %>/s_index/picture/feature-1.jpg" alt="Obrien Feature">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="home-wrapper home-3">
        <!-- Header Area Start Here -->
        
        <div class="product-area mt-text mb-no-text">
            <div class="container container-default custom-area">
                <div class="row">
                    <div class="col-lg-5 col-custom m-auto text-center">
                        <div class="section-content">
                            <h2 class="title-1 text-uppercase">特价商品</h2>
                            <div class="desc-content">
                                <p>所有最畅销的产品现在都为您提供，您可以在任何时间任何地点从这里购买这种产品</p>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="product-wrapper col-lg-12 col-custom">
                        <div class="product-slider" data-slick-options='{
                    "slidesToShow": 4,
                    "slidesToScroll": 1,
                    "infinite": true,
                    "arrows": false,
                    "dots": false
                    }' data-slick-responsive='[
                    {"breakpoint": 1200, "settings": {
                    "slidesToShow": 3
                    }},
                    {"breakpoint": 992, "settings": {
                    "slidesToShow": 2
                    }},
                    {"breakpoint": 576, "settings": {
                    "slidesToShow": 1
                    }}
                    ]'>
                    <c:forEach items="${telist}" var="data">
                    	 <div class="single-item">
                                <div class="single-product position-relative mb-30">
                                    <div class="product-image">
                                        <a class="d-block" href="product-details.html">
                                            <img src="<%=request.getContextPath() %>/image/${data.url1}" alt="" class="product-image-1 w-100">
                                        </a>
                                    </div>
                                    <div class="product-content" >
                                    	<div class="product-title">
                                             <h4 class="title-2"><span>${data.name}</span></h4>
                                        </div>
                                        <div class="price-box" >
                                            <span class="regular-price ">￥${data.price}</span>
                                            <span class="old-price"><del>￥${data.price+10}</del></span>
                                        </div>
                                        <div class="add-action d-flex position-absolute">
                                        	<a title="Add To cart" onclick="addcart(${data.id},${data.price})"><span style="font-size:15px">🛒加入购物车</span></a>
                                        </div>
	                       		   </div>
                                </div>
                            </div>
                            
                    </c:forEach>
                          
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Product Area End Here -->
    </div>
        <!-- Footer Area Start Here -->
        <footer class="footer-area">
            <div class="footer-widget-area">
                <div class="container container-default custom-area">
                    <div class="row">
                        <div class="col-12 col-sm-12 col-md-12 col-lg-3 col-custom">
                            <div class="single-footer-widget m-0">
                                <div class="footer-logo">
                                    <a href="">
                                        <img src="<%=request.getContextPath() %>/s_index/picture/footer.png" alt="Logo Image">
                                    </a>
                                </div>
                                <p class="desc-content">Obrien是您日常营养最好的配件店。你需要什么样的营养，你可以在这里得到</p>
                            </div>
                        </div>
                        <div class="col-12 col-sm-6 col-md-6 col-lg-2 col-custom">
                            <div class="single-footer-widget">
                                <h2 class="widget-title">信息</h2>
                                <ul class="widget-list">
                                    <li><a href="about-us.html">我们公司</a></li>
                                    <li><a href="contact-us.html">联系我们</a></li>
                                    <li><a href="about-us.html">我们的服务</a></li>
                                    <li><a href="about-us.html">职业生涯</a></li>
                                    <li><a href="about-us.html">为什么是我们?</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-12 col-sm-6 col-md-6 col-lg-2 col-custom">
                            <div class="single-footer-widget">
                                <h2 class="widget-title">快速连接</h2>
                                <ul class="widget-list">
                                    <li><a href="about-us.html">关于</a></li>
                                    <li><a href="blog.html">博客</a></li>
                                    <li><a href="shop.html">商店</a></li>
                                    <li><a href="cart.html">车辆</a></li>
                                    <li><a href="contact-us.html">联系</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-12 col-sm-6 col-md-6 col-lg-2 col-custom">
                            <div class="single-footer-widget">
                                <h2 class="widget-title">支持</h2>
                                <ul class="widget-list">
                                    <li><a href="contact-us.html">在线支持</a></li>
                                    <li><a href="contact-us.html">航运政策</a></li>
                                    <li><a href="contact-us.html">退货政策</a></li>
                                    <li><a href="contact-us.html">隐私政策</a></li>
                                    <li><a href="contact-us.html">服务条款</a></li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-12 col-sm-6 col-md-6 col-lg-3 col-custom">
                            <div class="single-footer-widget">
                                <h2 class="widget-title">看到信息</h2>
                                <div class="widget-body">
                                    <address>主城21号路H2号123号，你的地址在这里。<br>电话:01254 698 785,36598 254 987<br>电子邮件:#</address>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="footer-copyright-area">
                <div class="container custom-area">
                    <div class="row">
                        <div class="col-12 text-center col-custom">
                            <div class="copyright-content">
                                <p>Copyright &copy; 2023.Company name All rights reserved.<a target="_blank" href="https://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </footer>
        <!-- Footer Area End Here -->
    </div>


    <!-- Scroll to Top Start -->
    <a class="scroll-to-top" href="#">👆</a>
    <!-- Scroll to Top End -->

    <!-- JS
============================================ -->

    <!-- jQuery JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery-3.6.0.min.js"></script>
    <!-- jQuery Migrate JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery-migrate-3.3.2.min.js"></script>
    <!-- Modernizer JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/modernizr-2.8.3.min.js"></script>
    <!-- Bootstrap JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/bootstrap.bundle.min.js"></script>
    <!-- Slick Slider JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/slick.min.js"></script>
    <!-- Countdown JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery.countdown.min.js"></script>
    <!-- Ajax JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery.ajaxchimp.min.js"></script>
    <!-- Jquery Nice Select JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery.nice-select.min.js"></script>
    <!-- Jquery Ui JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery-ui.min.js"></script>
    <!-- jquery magnific popup js -->
    <script src="<%=request.getContextPath() %>/s_index/js/jquery.magnific-popup.min.js"></script>

    <!-- Main JS -->
    <script src="<%=request.getContextPath() %>/s_index/js/main.js"></script>
            			 <c:if test="${uId ne null}">
                            	<script type="text/javascript" src="<%=request.getContextPath()%>/jq/jquery-1.8.3.js"></script>
                             	<script type="text/javascript">
	                           		function addcart(id,price){
	                           			$.ajax({
	                           				url:"<%=request.getContextPath()%>/CartController/add",
	                           				type:"post",
	                           				data:{"user_id":${uId},"item_id":id,"price":price},
	                           				dataType:"text",
	                           				success:function(data){
	                           					if(data=="成功"){
	                           						alert("该商品加入购物车");
	                           					}
	                           				},
	                           				error:function(data){
	                           					if(data=="失败")
	                           					alert("失败");
	                           				}
	                           			});
	                           		}
                           		</script>
                            </c:if>
                            
    

</body>

</html>